var Datas = {
    data: {
        success: "true",
        errInfo: "成功",
        reports: [{
            sprintBacklogTaskDoingCount: "0",
            productId: "0000000036",
            sprintBacklogTaskDoneCount: "32",
            productName: "AOP",
            sprintBacklogTaskTodoCount: 2
        }, {
            sprintBacklogTaskDoingCount: "0",
            productId: "0000000035",
            sprintBacklogTaskDoneCount: "0",
            productName: "ESS",
            sprintBacklogTaskTodoCount: 0
        }, {
            sprintBacklogTaskDoingCount: "0",
            productId: "0000000037",
            sprintBacklogTaskDoneCount: "0",
            productName: "监控平台",
            sprintBacklogTaskTodoCount: 0
        }, {
            sprintBacklogTaskDoingCount: "3",
            productId: "0000000029",
            sprintBacklogTaskDoneCount: "5",
            productName: "积分商城",
            sprintBacklogTaskTodoCount: 5
        }, {
            sprintBacklogTaskDoingCount: "0",
            productId: "0000000027",
            sprintBacklogTaskDoneCount: "0",
            productName: "通用交费平台",
            sprintBacklogTaskTodoCount: 0
        }]
    },
    update: function(cb) {
        var a = document.getElementById('data').contentWindow.document.getElementsByTagName('body')[0].innerHTML;
        this.data = JSON.parse(a);
        console.log(this.data);
        cb();
    },
    getNameArr: function() {
        // console.log(this.data);
        var data = this.data.reports,
            arr = [];

        data.forEach(function(e, i) {
            arr.push(e.productName);
        });

        return arr;
    },
    getDataNum: function() {
        var data = this.data.reports,
            arr = [];

        data.forEach(function(e, i) {
            var obj = {
                value: parseInt(e.sprintBacklogTaskDoneCount) + parseInt(e.sprintBacklogTaskTodoCount),
                name: e.productName
            };
            arr.push(obj);
        });

        return arr;
    }
};